package com.nhjf.mobile.common.util;

import java.util.List;

import net.sf.json.JSONObject;
import net.sf.json.JSONArray;
/**
 * JSON 和 OBJECT 数据之间的转化
 * @author admin
 *
 */
public class JSONfield {
	private String field_one;
	private String field_two;
	private String field_three;
	private String field_four;
	private String field_five;

	public String fieldToJSONString() {
		return JSONObject.fromObject(this).toString();

	}
	
	public String fieldToJSONString(List<JSONfield>  fieldList) {
		return JSONArray.fromObject(fieldList).toString();

	}
    
	public List<JSONfield> JSONStringToFieldList(String JSONString) {
		JSONArray  jsonArray =	JSONArray.fromObject(JSONString);
		return (List<JSONfield>) JSONArray.toList(jsonArray, JSONfield.class);
	}
	public JSONfield JSONStringToField(String JSONString) {
		JSONObject jsonObject = JSONObject.fromObject(JSONString);
		
		return (JSONfield) JSONObject.toBean(jsonObject, JSONfield.class);
	}
	public String getField_one() {
		return field_one;
	}

	public void setField_one(String field_one) {
		this.field_one = field_one;
	}

	public String getField_two() {
		return field_two;
	}

	public void setField_two(String field_two) {
		this.field_two = field_two;
	}

	public String getField_three() {
		return field_three;
	}

	public void setField_three(String field_three) {
		this.field_three = field_three;
	}

	public String getField_four() {
		return field_four;
	}

	public void setField_four(String field_four) {
		this.field_four = field_four;
	}

	public String getField_five() {
		return field_five;
	}

	public void setField_five(String field_five) {
		this.field_five = field_five;
	}

}
